(function(window) {
    function Ajax(method = `get`, url, data = {}, refunc) {
        const sendObj = {
            method: method,
            url: url,
            // timeout: 3000,
            data: data,
            success: refunc
        }
        if (data instanceof FormData) {
            sendObj.contentType = false;
            sendObj.processData = false;
        }
        $.ajax(sendObj);
    }
    let url = top.location.href.split(`//`)[1].split(`/`)[1];
    if (url !== `login.html` && url !== `index.html`)
        Ajax(`get`, `/my/userinfo`, {}, function() {});
    window.Ajax = Ajax;
})(window);